package cn.changein.framework.modular.fileInfo.service;

import cn.changein.framework.kernel.model.response.ResponseData;
import cn.changein.framework.modular.templateInfo.model.params.TemplateInfoParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;

public interface FileService {

    /*

     * @Description //TODO 文件上传
     * @Date 2020-11-26 16:39
     * @MethodName uploadFile
     * @Param [file, moduleCode,moduleName, servletRequest]
     * @return cn.changein.framework.kernel.model.response.ResponseData
     **/
    ResponseData uploadFile(MultipartFile file, String moduleCode, String moduleName, HttpServletRequest servletRequest, HttpServletResponse httpServletResponse);

    /*

     * @Description //TODO 文件下载
     * @Date 2020-11-26 20:19
     * @MethodName downLoadFile
     * @Param [moduleCode, moduleName, fileName]
     * @return cn.changein.framework.kernel.model.response.ResponseData
     **/
    void downLoadFile(String moduleCode, String moduleName, String fileName, HttpServletRequest servletRequest, HttpServletResponse httpServletResponse) throws FileNotFoundException;

    ResponseData templateUploadFile(MultipartFile file, TemplateInfoParam templateInfoParam, HttpServletRequest servletRequest, HttpServletResponse httpServletResponse);

    /**
     * 在线预览文件
     * @param finalName 文件唯一标识id
     * @param request
     * @param response
     */
    void previewPdfFile(String finalName,HttpServletRequest request,HttpServletResponse response);

}
